#include "ResourceUtil.h"
#include "cocos2d.h"
USING_NS_CC;

NS_BEGIN(elloop);

bool ResourceUtil::isResourceExist(const std::string& resourceName) {
    /*auto filePath = FileUtils::sharedFileUtils()->fullPathForFilename(resourceName);
    FILE* fp = fopen(filePath.c_str(), "r");
    if (fp) {
    fclose(fp);
    return true;
    }
    return false;*/

    return FileUtils::getInstance()->isFileExist(resourceName);
}

std::string ResourceUtil::dumpSearchPaths() {
    auto pathArray = FileUtils::getInstance()->getSearchPaths();
    std::string paths;
    for (auto str : pathArray) {
        paths.append(str);
        paths.append("\n");
    }
    return paths;
}

NS_END(elloop);
